package com.jservice.web.smkRecharge;

import com.jservice.framework.annotation.RouteBind;
import com.jservice.framework.dto.Filter;
import com.jservice.framework.dto.Pageable;
import com.jservice.framework.dto.Pager;
import com.jservice.framework.utils.StringUtils;
import com.jservice.web.base.JBaseController;

import java.util.ArrayList;
import java.util.List;

/**
 * RechargeController - 充值列表
 *
 * @author cwvian
 * @version 1.0
 * @date 2017/5/27
 */
@RouteBind(path = "/smk/recharge")
public class SmkRechargeController extends JBaseController {

	public void list(){
		String recharge_method = getPara("recharge_method");
		String trade_type = getPara("trade_type");
		String status = getPara("status");

		List<Filter> filters = new ArrayList<>();
		Pageable pageable = getPageable();
		if (StringUtils.isNotEmpty(recharge_method)){
			filters.add(Filter.eq("recharge_method",recharge_method));
		}
		if (StringUtils.isNotEmpty(trade_type)){
			filters.add(Filter.eq("trade_type",trade_type));
		}
		if (StringUtils.isNotEmpty(status)){
			filters.add(Filter.eq("status",status));
		}
		pageable.setFilters(filters);
		Pager pager = SmkReChargeService.me().findPage(pageable);

		setAttr("pager",pager);
		keepPara();
		render("list");
	}

}
